<?php
if(!defined('RSMSINC'))
{
	exit("Request Error!");
}
function lib_brochannel(&$ctag,&$refObj)
{
	global $dsql,$envs;
	
	//属性处理
	$attlist="row|12,titlelen|24,aid|";
	FillAttsDefault($ctag->CAttribute->Items,$attlist);
	extract($ctag->CAttribute->Items, EXTR_SKIP);
	
	$aid = $refObj->ArcID;
	$revalue = $aid;
	
	$row = $dsql->GetOne ("Select typeid from `#@__archives` where id='$aid'");
	$row1 = $dsql->GetOne ("Select reid from `#@__arctype` where id='$row[typeid]'");
	$sql = "Select * from `#@__arctype` where reid='$row1[reid]'");
	
	//你需编写的代码，不能用echo之类语法，把最终返回值传给$revalue
	//------------------------------------------------------
	$dtp2 = new RsmsTagParse();
	$dtp2->SetNameSpace('field','[',']');
	$dtp2->LoadSource($innertext);
	$dtp2->tplLang = $lang;
	if(!empty($refObj->Lang)) $dtp2->handLang = $refObj->Lang;
	
	$dsql->SetQuery($sql);
	$dsql->Execute();
	
	//------------------------------------------------------
	return $revalue;
}
?>